<?php
$arr = 123;

function abc($a){
     $a();
}

abc(function () use (&$arr){
     $arr = 1;
});

echo $arr;